package com.wingsboat.graphvis.service.impl;

import java.util.List;
import com.wingsboat.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wingsboat.graphvis.mapper.GvNodeLinkMapper;
import com.wingsboat.graphvis.domain.GvNodeLink;
import com.wingsboat.graphvis.service.IGvNodeLinkService;

/**
 * 节点连接Service业务层处理
 * 
 * @author wangzhong
 * @date 2024-04-20
 */
@Service
public class GvNodeLinkServiceImpl implements IGvNodeLinkService 
{
    @Autowired
    private GvNodeLinkMapper gvNodeLinkMapper;

    /**
     * 查询节点连接
     * 
     * @param linkId 节点连接主键
     * @return 节点连接
     */
    @Override
    public GvNodeLink selectGvNodeLinkByLinkId(Long linkId)
    {
        return gvNodeLinkMapper.selectGvNodeLinkByLinkId(linkId);
    }

    /**
     * 查询节点连接列表
     * 
     * @param gvNodeLink 节点连接
     * @return 节点连接
     */
    @Override
    public List<GvNodeLink> selectGvNodeLinkList(GvNodeLink gvNodeLink)
    {
        return gvNodeLinkMapper.selectGvNodeLinkList(gvNodeLink);
    }

    /**
     * 新增节点连接
     * 
     * @param gvNodeLink 节点连接
     * @return 结果
     */
    @Override
    public int insertGvNodeLink(GvNodeLink gvNodeLink)
    {
        gvNodeLink.setCreateTime(DateUtils.getNowDate());
        return gvNodeLinkMapper.insertGvNodeLink(gvNodeLink);
    }

    /**
     * 修改节点连接
     * 
     * @param gvNodeLink 节点连接
     * @return 结果
     */
    @Override
    public int updateGvNodeLink(GvNodeLink gvNodeLink)
    {
        gvNodeLink.setUpdateTime(DateUtils.getNowDate());
        return gvNodeLinkMapper.updateGvNodeLink(gvNodeLink);
    }

    /**
     * 批量删除节点连接
     * 
     * @param linkIds 需要删除的节点连接主键
     * @return 结果
     */
    @Override
    public int deleteGvNodeLinkByLinkIds(Long[] linkIds)
    {
        return gvNodeLinkMapper.deleteGvNodeLinkByLinkIds(linkIds);
    }

    /**
     * 删除节点连接信息
     * 
     * @param linkId 节点连接主键
     * @return 结果
     */
    @Override
    public int deleteGvNodeLinkByLinkId(Long linkId)
    {
        return gvNodeLinkMapper.deleteGvNodeLinkByLinkId(linkId);
    }
}
